AUTOMAKE_OPTIONS = subdir-objects


COMMONLIB_CPPFLAGS = -I$(top_srcdir)/$(COMMONLIB_INCLUDE_DIR)
COMMONLIB_LIB = $(top_builddir)/$(COMMONLIB_LIBRARY)


noinst_PROGRAMS = t_config_file t_dict t_fuzzy t_query t_lookupdata

EXTRA_DIST = sample1.ifo sample1.idx sample1.dict

if GNOME_SUPPORT
GCONF_MODULE_HPP=$(top_builddir)/src/gconf_file.hpp 
GCONF_MODULE_CPP=$(top_builddir)/src/gconf_file.cpp
endif

t_config_file_SOURCES = t_config_file.cpp \
	$(top_builddir)/src/config_file.hpp \
	$(top_builddir)/src/inifile.hpp $(top_builddir)/src/inifile.cpp \
	$(GCONF_MODULE_HPP) $(GCONF_MODULE_CPP)

t_dict_SOURCES = t_dict.cpp
t_dict_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_fuzzy_SOURCES = t_fuzzy.cpp
t_fuzzy_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_query_SOURCES = t_query.cpp
t_query_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

t_lookupdata_SOURCES = t_lookupdata.cpp
t_lookupdata_DEPENDENCIES = $(top_builddir)/src/lib/libstardict.la

## place libstardict.la before any system library, otherwise build with --as-needed linker option may fail
LDADD = $(top_builddir)/src/lib/libstardict.la $(STARDICT_LIBS)
## -I$(top_builddir) is for config.h, it's generated by configure in the build dir
AM_CPPFLAGS = @STARDICT_CFLAGS@ -I$(top_builddir) \
	-I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/lib $(COMMONLIB_CPPFLAGS)

TESTS = t_config_file t_dict t_query t_lookupdata
